## API Report File for "@backstage/plugin-badges-backend"

> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).

```ts
import { BackendFeature } from '@backstage/backend-plugin-api';
import { CatalogApi } from '@backstage/catalog-client';
import { Config } from '@backstage/config';
import { Entity } from '@backstage/catalog-model';
import express from 'express';
import { IdentityApi } from '@backstage/plugin-auth-node';
import { Logger } from 'winston';
import { PluginEndpointDiscovery } from '@backstage/backend-common';
import { TokenManager } from '@backstage/backend-common';

// @public (undocumented)
export interface Badge {
  color?: string;
  description?: string;
  kind?: 'entity';
  label: string;
  labelColor?: string;
  link?: string;
  message: string;
  style?: BadgeStyle;
}

// @public (undocumented)
export const BADGE_STYLES: readonly [
  'plastic',
  'flat',
  'flat-square',
  'for-the-badge',
  'social',
];

// @public (undocumented)
export type BadgeBuilder = {
  getBadges(): Promise<BadgeInfo[]>;
  createBadgeJson(options: BadgeOptions): Promise<BadgeSpec>;
  createBadgeSvg(options: BadgeOptions): Promise<string>;
};

// @public (undocumented)
export interface BadgeContext {
  // (undocumented)
  badgeUrl: string;
  // (undocumented)
  config: Config;
  // (undocumented)
  entity?: Entity;
}

// @public (undocumented)
export interface BadgeFactories {
  // (undocumented)
  [id: string]: BadgeFactory;
}

// @public (undocumented)
export interface BadgeFactory {
  // (undocumented)
  createBadge(context: BadgeContext): Badge;
}

// @public (undocumented)
export type BadgeInfo = {
  id: string;
};

// @public (undocumented)
export type BadgeOptions = {
  badgeInfo: BadgeInfo;
  context: BadgeContext;
};

// @public (undocumented)
export type BadgeSpec = {
  id: string;
  badge: Badge;
  url: string;
  markdown: string;
};

// @public
const badgesPlugin: () => BackendFeature;
export default badgesPlugin;

// @public
export interface BadgesStore {
  // (undocumented)
  getBadgeFromUuid(uuid: string): Promise<
    | {
        name: string;
        namespace: string;
        kind: string;
      }
    | undefined
  >;
  // (undocumented)
  getBadgeUuid(
    name: string,
    namespace: string,
    kind: string,
  ): Promise<{
    uuid: string;
  }>;
}

// @public (undocumented)
export type BadgeStyle = (typeof BADGE_STYLES)[number];

// @public (undocumented)
export const createDefaultBadgeFactories: () => BadgeFactories;

// @public (undocumented)
export function createRouter(options: RouterOptions): Promise<express.Router>;

// @public (undocumented)
export class DefaultBadgeBuilder implements BadgeBuilder {
  constructor(factories: BadgeFactories);
  // (undocumented)
  createBadgeJson(options: BadgeOptions): Promise<BadgeSpec>;
  // (undocumented)
  createBadgeSvg(options: BadgeOptions): Promise<string>;
  // (undocumented)
  getBadges(): Promise<BadgeInfo[]>;
  // (undocumented)
  protected getMarkdownCode(params: Badge, badgeUrl: string): string;
}

// @public (undocumented)
export interface RouterOptions {
  // (undocumented)
  badgeBuilder?: BadgeBuilder;
  // (undocumented)
  badgeFactories?: BadgeFactories;
  // (undocumented)
  badgeStore?: BadgesStore;
  // (undocumented)
  catalog?: CatalogApi;
  // (undocumented)
  config: Config;
  // (undocumented)
  discovery: PluginEndpointDiscovery;
  // (undocumented)
  identity: IdentityApi;
  // (undocumented)
  logger: Logger;
  // (undocumented)
  tokenManager: TokenManager;
}
```
